import type { MenuProps, MenuItemProps } from 'antd';
import { Dropdown, Space, Button } from 'antd';

interface DropdownComponentParams {
  title: string;
  items: MenuProps['items'];
  onClick: MenuItemProps['onClick'];
}

export const DropdownComponent = (props: DropdownComponentParams) => {
  const { items, title, onClick } = props;
  return (
    <Dropdown menu={{ items, onClick }} placement="bottomLeft">
      <Space>
        <Button size="small">{title}</Button>
      </Space>
    </Dropdown>
  );
};
